import Logo from "./common/comps/logo";
import LoginInfo from "./common/comps/loginInfo";
import "../../HMS/css/Header.css"
import CookieUtils from "pages/ruijing/common/utils/CookieUtils";

function Header(props) {
	const commonHeaderConfig = useStoreState("commonHeaderConfig");
	const {orgid,orgnization,username} = props;
	let host = window.location.host.indexOf("localhost")>-1?(window.location.host + '/rjdemo/www'):window.location.host;
	const purchaseUrl = window.location.protocol+'//'+host+'/purchaser/index.html'

	React.useEffect(() => {
		Uts.changeHeader();
	}, []);

	return (

		<div className="zen_w-p100 zen_h-50 zen_flex zen_bg-13b5bd">
			{/*render HMS Header Logo*/}
			<Logo
                orgid = {orgid}
				orgnization = {orgnization}
            ></Logo>

			{/*render HMS Header Link back to WWW*/}
            <div className="zen_fs-16 zen_h-50 zen_w-142 zen_l-h-50 zen_t-c Link-To-Purchase">
				<a className="zen_FFFFFF"
					href={purchaseUrl}
				>采购首页</a>
			</div>

            {/*render Login Information */}
			<LoginInfo
				username = {username}
				orgnization = {orgnization}
			></LoginInfo>
		</div>

	);
}

export default Header;
